<template>
  <el-dialog title="详情" :close-on-click-modal="false" :visible.sync="visible">
    <el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">

      <el-form-item label="审核意见" v-if="dataForm.audit_status == 2">
        <div v-if="dataForm.audit_status == 2">
          <el-input v-model="dataForm.audit_remark" disabled></el-input>
        </div>
      </el-form-item>
      <el-form-item label="企业名称">
        <el-input v-model="dataForm.company_name" disabled></el-input>
      </el-form-item>

      <el-form-item label="统一信用代码">
        <el-input v-model="dataForm.credit_code" disabled></el-input>
      </el-form-item>
      <el-form-item label="经营范围">
        <el-input v-model="dataForm.business_scope" disabled></el-input>
      </el-form-item>
      <el-form-item label="企业所在地区">
        <el-input v-model="dataForm.province" disabled></el-input>
      </el-form-item>
      <el-form-item label="详细地址">

        <el-input v-model="dataForm.company_address" disabled type="textarea" :rows="3"></el-input>
      </el-form-item>
      <el-form-item label="法人姓名">
        <el-input v-model="dataForm.legal_representative" disabled></el-input>
      </el-form-item>
      <el-form-item label="证件类型">
        <el-input v-model="dataForm.id_type == 0 ? '身份证' : '护照'" disabled></el-input>
      </el-form-item>
      <el-form-item label="证件号码">
        <el-input v-model="dataForm.id_number" disabled></el-input>
      </el-form-item>
      <el-form-item label="法人手机号">
        <el-input v-model="dataForm.lr_mobile" disabled></el-input>
      </el-form-item>
      <el-form-item label="法人邮箱">
        <el-input v-model="dataForm.lr_email" disabled></el-input>
      </el-form-item>
      <el-form-item label="营业执照">
        <!-- <img class="table-img" :src="dataForm.business_license_images" /> -->
        <img class="table-img mr10" v-for="(item, key) in dataForm.business_license_images" :key="key" :src="item" />
      </el-form-item>
      <el-form-item label="申请身份证">
        <img class="table-img mr10" v-for="(item) in dataForm.identty_images" :src="item" />
      </el-form-item>
      <el-form-item label="店铺名称">
        <el-input v-model="dataForm.shop_name" disabled></el-input>
      </el-form-item>
      <el-form-item label="店铺所在地区">
        <el-input v-model="dataForm.province_name + dataForm.city_name + dataForm.area_name" disabled></el-input>
      </el-form-item>
      <!-- <el-form-item label="所属街道">
        <el-input v-model="dataForm.street_name" disabled></el-input>
      </el-form-item>
      <el-form-item label="所属社区">
        <el-input v-model="dataForm.community_name" disabled></el-input>
      </el-form-item> -->
      <el-form-item label="详细地址">
        <el-input v-model="dataForm.address" type="textarea" :rows="3" disabled></el-input>
      </el-form-item>
      <el-form-item label="定位地址">
        <el-input v-model="dataForm.map_punctuation" type="textarea" :rows="3" disabled></el-input>
      </el-form-item>
      <el-form-item label="售后电话">
        <el-input v-model="dataForm.customer_service_phone" disabled></el-input>
      </el-form-item>
      <el-form-item label="营业时间">
        <el-input v-model="dataForm.business_hours" disabled></el-input>
      </el-form-item>
      <el-form-item label="时间段">
        <el-input v-model="dataForm.time_quantum" disabled></el-input>
      </el-form-item>
      <el-form-item label="店铺简介">
        <el-input v-model="dataForm.remark" type="textarea" :rows="3" disabled></el-input>
      </el-form-item>
      <el-form-item label="场地说明">
        <el-input v-model="dataForm.place_remark" type="textarea" :rows="3" disabled></el-input>
      </el-form-item>
      <el-form-item label="店铺logo">
        <img class="table-img" :src="dataForm.logo" />
      </el-form-item>
      <el-form-item label="店铺图片">
        <img class="table-img mr10" v-for="(item) in dataForm.store_images" :src="item" />
      </el-form-item>
      <el-form-item label="运营人姓名">
        <el-input v-model="dataForm.loser" disabled></el-input>
      </el-form-item>
      <el-form-item label="运营人电话">
        <el-input v-model="dataForm.mobile" disabled></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
import seviceApi from '@/api/serviceApi.js'
export default {
  data () {
    return {
      visible: false,
      dataForm: {
        address: '',
        admin_id: null,
        area_code: '',
        area_name: '',
        business_hours: '',
        business_license_images: '',
        business_scope: '',
        city_code: '',
        city_name: '',
        company_address: '',
        company_name: '',
        create_time: '',
        credit_code: '',
        customer_service_phone: null,
        distribution: true,
        gains_able: 0,
        gains_settled: 0,
        gains_take_out: 0,
        id_number: '',
        id_type: 0,
        identty_images: '',
        invitation_code: null,
        legal_representative: '',
        lock_status: 0,
        lock_time: null,
        logo: '',
        loser: null,
        lr_email: '',
        lr_mobile: '',
        main_name: null,
        map_punctuation: '',
        mobile: '',
        notice_items: '',
        place_remark: '',
        platform_shop: false,
        province: '',
        province_code: '',
        province_name: '',
        remark: '',
        shop_name: '',
        store_images: '',
        time_quantum: '',
        tx_latitude: '',
        tx_longitude: ''
      }
    }
  },
  methods: {
    init (id, type) {
      this.dataForm.id = id || 0
      this.visible = true
      this.dataForm.id_type = ''
      this.$nextTick(() => {
        this.$refs['dataForm'].resetFields()
      })
      if (type == 1) {
        seviceApi.getShopInfo(id).then(res => {
          if (res && res.data.code == 200) {
            if (res.data.data.identty_images) {
              res.data.data.identty_images = res.data.data.identty_images.split(',')
            }
            if (res.data.data.store_images) {
              res.data.data.store_images = res.data.data.store_images.split(',')
            }
            if (res.data.data.business_license_images) {
              res.data.data.business_license_images = res.data.data.business_license_images.split(',')
            }
            this.dataForm = res.data.data
            // this.dataForm.province = this.dataForm.province + this.dataForm.street_name + this.dataForm.community_name
          }
        })
      } else {
        seviceApi.getShopapplyInfo(id).then(res => {
          if (res && res.data.code == 200) {
            if (res.data.shopApply.identty_images) {
              res.data.shopApply.identty_images = res.data.shopApply.identty_images.split(',')
            }
            if (res.data.shopApply.store_images) {
              res.data.shopApply.store_images = res.data.shopApply.store_images.split(',')
            }
            if (res.data.shopApply.business_license_images) {
              res.data.shopApply.business_license_images = res.data.shopApply.business_license_images.split(',')
            }
            this.dataForm = res.data.shopApply;
            // this.dataForm.province = this.dataForm.province + this.dataForm.street_name + this.dataForm.community_name
          }
        })
      }
    }
  }
}
</script>
<style scoped>
.fontcolor {
  font-size: 12px;
  color: #999;
}
</style>
